package Test;

public class Persion {
    public String name;
    public String gender;
    public int age;
    public static String classRoom;

    {//实例代码块
        name = "王撕葱";
        gender = "男";
        age = 30;
        System.out.println("构造代码块一次");
    }

    static{
        classRoom = "教室306";
        System.out.println("静态代码块执行一次");
    }

    public Persion(){
        System.out.println("我是构造方法");
    }
    public static void main(String[] args) {
        Persion p1 = new Persion();
        System.out.println(p1.classRoom);
        Persion p2 = new Persion();
        System.out.println(p2.classRoom);
        Persion p3 = new Persion();
        System.out.println(p3.classRoom);
    }
}
